package com.yst.suivi.data.activities;

import javax.ejb.CreateException;
import javax.ejb.EntityBean;

import com.yst.suivi.data.AbstractEntityBean;

/**
 * @author stolf
 * @ejb.bean name="ActivityHistoric" type="CMP" cmp-version="2.x"
 *           schema="activityHistoric" local-jndi-name="ActivityHistoricBean"
 *           view-type="local" primkey-field = "id" reentrant = "True"
 * @ejb.home generate="local"
 * @ejb.persistence table-name = "activityHistoric"
 * @jboss.entity-command name = "key-generator"
 * @jboss.read-ahead eager-load-group = "most" strategy = "on-load"
 *                   page-size="25"
 * @jboss.load-group name="most"
 * @ejb.interface local-extends = "javax.ejb.EJBLocalObject"
 * @ejb.finder signature="com.yst.suivi.data.activities.ActivityHistoryc
 *             findFor(com.yst.suivi.data.activities.Activity act,
 *             java.lang.Integer weekNumber, java.lang.Integer annee)"
 *             query="SELECT OBJECT(g) FROM activityHistoric AS g WHERE
 *             g.activity=?1 AND g.weekNumber=?2 and g.annee=?3"
 */
public abstract class ActivityHistoricBean extends AbstractEntityBean implements EntityBean
{
	/**
	 * @return
	 * @throws CreateException
	 * @ejb.create-method view-type = "local"
	 */
	public String ejbCreate() throws CreateException
	{
		// setStatus(StatusConstants.IN_PROGRESS);
		return null;
	}

	public void ejbPostCreate()
	{
		// by default nothing to do
	}

	/**
	 * Return the primary key of the object
	 * 
	 * @ejb.interface-method view-type = "local"
	 * @ejb.persistence
	 * @jboss.jdbc-type type = "VARCHAR"
	 * @jboss.sql-type type = "VARCHAR(255)"
	 */
	public abstract String getId();

	/**
	 * Fix the primary key of the object. The method should be used only by the
	 * container
	 * 
	 * @ejb.interface-method view-type = "local"
	 */
	public abstract void setId(String id);

	/**
	 * Retourne ltemps estime pour finir la tache
	 * 
	 * @ejb.interface-method view-type = "local"
	 * @ejb.persistence
	 * @jboss.load-group name="most"
	 */
	public abstract Float getRaf();

	/**
	 * Positionne le temps estime pour finir la tache
	 * 
	 * @ejb.interface-method view-type = "local"
	 */
	public abstract void setRaf(Float raf);

	/**
	 * Retourne la semaine de l'historique
	 * 
	 * @ejb.interface-method view-type = "local"
	 * @ejb.persistence
	 * @jboss.load-group name="most"
	 */
	public abstract Integer getWeekNumber();

	/**
	 * Positionne la semaine de l'historique
	 * 
	 * @ejb.interface-method view-type = "local"
	 */
	public abstract void setWeekNumber(Integer weekNumber);
	
	/**
	 * Retourne l'annee de l'historique
	 * 
	 * @ejb.interface-method view-type = "local"
	 * @ejb.persistence
	 * @jboss.load-group name="most"
	 */
	public abstract Integer getAnnee();

	/**
	 * Positionne l'annee de l'historique
	 * 
	 * @ejb.interface-method view-type = "local"
	 */
	public abstract void setAnnee(Integer annee);

	/**
	 * La methode lie l'historic a son activite
	 * 
	 * @return
	 * @ejb.relation name="activityhistoric-activity" role-name =
	 *               "ActivityHistoryActivity" target-role-name =
	 *               "ActivityHistoricRole" target-multiple = "yes"
	 *               target-ejb="Activity"
	 * @jboss.relation related-pk-field = "id" fk-constraint = "true" fk-column =
	 *                 "activityId"
	 * @ejb.interface-method view-type = "local"
	 */
	public abstract Activity getActivity();

	/**
	 * La methode lie l'historic a son activite
	 * 
	 * @param plf
	 * @ejb.interface-method view-type = "local"
	 */
	public abstract void setActivity(Activity folder);
}
